An SD card widely spreads as a small portable nonvolatile memory for use in portable equipment such as a digital camera or a cellular phone, or electrical household equipment such as a PC or a television set. Transfer of data and a command between the SD card and a host device (CPU) is controlled by a host controller.
The latest SD card has a much higher transfer speed than the conventional SD card, and hence data cannot appropriately be sampled with a previous fixed delay amount during data reception, and it becomes necessary to set a phase of a sampling position.
To set the phase of a sampling clock, tuning is usually performed before actually transferring the data, to judge an optimum phase. The tuning means an operation of determining an optimum sampling position in an initialization sequence of the SD card. That is, the host device changes a shift amount of the sampling clock little by little to repeatedly read and sample a tuning pattern from the SD card. This tuning pattern is an already known data pattern, and the same pattern is beforehand stored in both the SD card and the host controller. The host device judges whether or not the data obtained by this sampling matches the tuning pattern stored in the host controller, and determines, as the optimum sampling position, the shift amount with which correct data is most stably obtained.
However, if the phase shifts owing to a temperature or the like during the transfer, the shift cannot be detected, whereby re-tuning needs to be performed every short transfer interval.
To solve the above problem, there has been suggested a host controller which samples received data to detect a phase shift, thereby obtaining information for judging whether or not the re-tuning is necessary. Only when the phase shift occurs, the host controller performs the re-tuning. This host controller automatically corrects the sampling position based on the phase shift detection result. This enables a countermeasure against the phase shift, but there has been a problem that it is not possible to detect a phase shift error which exceeds an allowable variance range of the phase shift.